List and update manufacturers.
Get data for one manufacturer.
Parameters
int manufacturerid
ApiRequest requestOptions
Returns
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:apirequest='Prodibas.API.V1.Manufacturer' xmlns:requestparams='Prodibas.API.V1.Parameters'> <soapenv:Header/> <soapenv:Body> <apirequest:GetManufacturer> <apirequest:manufacturerId>616</apirequest:manufacturerId> <apirequest:requestOptions> <requestparams:Authentication> <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU616</requestparams:Key> </requestparams:Authentication> </apirequest:requestOptions> </apirequest:GetManufacturer> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <GetManufacturerResponse xmlns='Prodibas.API.V1.Manufacturer'> <GetManufacturerResult xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:Data xmlns:b='Prodibas.API.V1.Model'> <b:Address>Drakenbergsgatan 21 BV</b:Address> <b:Alias>Gästföretaget!</b:Alias> <b:AllowUseApi>true</b:AllowUseApi> <b:ApiRoleUserId>1</b:ApiRoleUserId> <b:BankGiro>1111-1111</b:BankGiro> <b:City>Stockholm</b:City> <b:CoAddress>Testadress 2</b:CoAddress> <b:CountryIdentifier>SE</b:CountryIdentifier> <b:Ean/> <b:Email>info@vvsinfo.se</b:Email> <b:Fax>88888888888</b:Fax> <b:Id>616</b:Id> <b:InfoText/> <b:InvoiceAddress>Drakenbergsgatan 21 BV</b:InvoiceAddress> <b:InvoiceByEmail>false</b:InvoiceByEmail> <b:InvoiceCity/> <b:InvoiceCountryIdentifier>SE</b:InvoiceCountryIdentifier> <b:InvoiceReference/> <b:InvoiceZipCode/> <b:IsContractSigned>false</b:IsContractSigned> <b:IsMemberManufacturerCouncel>false</b:IsMemberManufacturerCouncel> <b:IsSafeWaterCertified>true</b:IsSafeWaterCertified> <b:IsSafeWaterCertifiedIsSpecified>false</b:IsSafeWaterCertifiedIsSpecified> <b:IsWholesaler>false</b:IsWholesaler> <b:ModifiedAt>2020-09-23T13:32:47</b:ModifiedAt> <b:Name>Gästföretaget</b:Name> <b:OrgNumber>5566775037</b:OrgNumber> <b:PayId>Inget</b:PayId> <b:PayIdStr>Inget</b:PayIdStr> <b:Phone>08-644 85 00</b:Phone> <b:PlusGiro>22222222-2</b:PlusGiro> <b:RegisteredAt>2016-04-27T09:01:19</b:RegisteredAt> <b:ResponsibleAdminInfo i:nil='true'/> <b:ResponsibleBvdInfo> <b:Email>test.testsson@gastforetaget.se</b:Email> <b:Name>Test Testsson</b:Name> <b:Phone>08-99 99 99</b:Phone> <b:Type>Bvd</b:Type> </b:ResponsibleBvdInfo> <b:ResponsibleCEOInfo i:nil='true'/> <b:ResponsibleDocsInfo i:nil='true'/> <b:ResponsibleEconomyInfo i:nil='true'/> <b:ResponsibleImagesInfo i:nil='true'/> <b:ResponsibleMarketInfo i:nil='true'/> <b:Status>Active</b:Status> <b:UserMessage/> <b:VisitingAddress>Drakenbergsgatan 21 (ingång 23)</b:VisitingAddress> <b:Website>www.vvsinfo.se</b:Website> <b:ZipCode>117 41</b:ZipCode> </a:Data> <a:User i:nil='true' xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'/> </GetManufacturerResult> </GetManufacturerResponse> </s:Body> </s:Envelope>
Get data for all manufacturers api user is authorized to view.
Parameters
ApiRequest requestOptions
Returns
ApiResponse<List<ApiManufacturer>>
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:apirequest='Prodibas.API.V1.Manufacturer' xmlns:requestparams='Prodibas.API.V1.Parameters'> <soapenv:Header/> <soapenv:Body> <apirequest:GetManufacturers> <apirequest:requestOptions> <requestparams:Authentication> <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU616</requestparams:Key> </requestparams:Authentication> </apirequest:requestOptions> </apirequest:GetManufacturers> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <GetManufacturersResponse xmlns='Prodibas.API.V1.Manufacturer'> <GetManufacturersResult xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:Data xmlns:b='Prodibas.API.V1.Model'> <b:ApiManufacturer> ... manufacturer properties </b:ApiManufacturer> ... </a:Data> <a:User i:nil='true' xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'/> </GetManufacturersResult> </GetManufacturersResponse> </s:Body> </s:Envelope>
Update data for one manufacturer.
NOTE! As of 2016-06-07 Only SafeWater field is supported and only for those users authorized to update it.
Parameters
ApiManufacturer manufacturer
.
ApiRequest requestOptions
Returns
List<ApiModelValidationError>
of validation errors
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:apirequest='Prodibas.API.V1.Manufacturer' xmlns:model='Prodibas.API.V1.Model' xmlns:requestparams='Prodibas.API.V1.Parameters'> <soapenv:Header/> <soapenv:Body> <apirequest:UpdateManufacturer> <apirequest:manufacturer xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> ... <model:IsSafeWaterCertified>true</model:IsSafeWaterCertified> <model:IsSafeWaterCertifiedIsSpecified>true</model:IsSafeWaterCertifiedIsSpecified> ... </apirequest:manufacturer> <apirequest:requestOptions> <requestparams:Authentication> <requestparams:CompanyIdentifier>MANU616</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU616</requestparams:Key> </requestparams:Authentication> </apirequest:requestOptions> </apirequest:UpdateManufacturer> </soapenv:Body> </soapenv:Envelope>
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <UpdateManufacturerResponse xmlns='Prodibas.API.V1.Manufacturer'> <UpdateManufacturerResult xmlns:a='Prodibas.API.V1.Model' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'/> </UpdateManufacturerResponse> </s:Body> </s:Envelope>
There are some objects that are used in requests/responses across the API services and methods. For example:
The ApiAuthentication object contains three parts:
public class ApiAuthentication { public string CompanyIdentifier { get; set; } // string.Format("MANU{0}", company.Id) public Industry Industry { get; set; } // see enum below public string Key { get; set; } // any of your active API keys. } public enum Industry { VVS = 1, SEG = 2 }
In example, the key is for the dev environment. Not applicable elsewhere.
<requestparams:Authentication> <requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU999</requestparams:Key> </requestparams:Authentication>
Every request has to provide authentication information as an input parameter.
Anonymous requests are blocked.
public class ApiRequest { public ApiAuthentication Authentication { get; set; } }
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:apirequest='Prodibas.API.V1' xmlns:outputopts='Prodibas.API.V1.Parameters.OutputOptions' xmlns:requestparams='Prodibas.API.V1.Parameters'> <soapenv:Header/> ... <apirequest:GetByIdentifier> (example method) ... <apirequest:productIdentifier> (example params for this method) ... <apirequest:structuredOutputOptions> (example optional params for this method) ... <apirequest:requestOptions> (required authentication for all requests ) <requestparams:Authentication> <requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU999</requestparams:Key> </requestparams:Authentication> </apirequest:requestOptions>
The ApiQueuedRequest is a request that will be queued and processed in batch.
It will return a QueuedId of the queued request which then can be used to poll result.
public class ApiQueuedRequest : ApiRequest { public string PingBackUrl { get; set; } }
If PingBackUrl is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:apirequest='Prodibas.API.V1' xmlns:requestparams='Prodibas.API.V1.Parameters' xmlns:outputopts='Prodibas.API.V1.Parameters.OutputOptions'> <soapenv:Header/> <soapenv:Body> ... <apirequest:GetManyByIdentifiersQueued> (example method) ... <apirequest:productIdentifier> (example params for this method) ... <apirequest:structuredOutputOptions> (example optional params for this method) ... <apirequest:queuedRequestOptions> (required authentication for all requests ) <requestparams:Authentication> <requestparams:CompanyIdentifier>MANU999</requestparams:CompanyIdentifier> <requestparams:Industry>VVS</requestparams:Industry> <requestparams:Key>DEVMANU999</requestparams:Key> </requestparams:Authentication> <requestparams:PingBackUrl></requestparams:PingBackUrl> (optional PingBackUrl) </apirequest:queuedRequestOptions>
The ApiUpdateRequest object is one of the parameters for UpdateSingle
If an update request attempts to update documents (the term documents refers to both images and documents that are linked to a product) the documents are provided in a list of ApiUploadDocument (see below).
The product uri and document is linked together by using the same string value for ApiUploadDocument.FileName
and ApiProductUri.Url
. Several products and/or product uris can link to the same document. In this case it is only necessary to provide one document in the request.
FileName
must be unique within your company's "sandbox". Prodibas will rename the files according to the internal rules.
Note: The fields Type
, TypeIsSpecified
, Uri
, UriIsSpecified
and UrisIsSpecified
must be set for any changes of a document to have effect. If the document referred to in field Uri
is not an external link, a ApiUploadDocument
must also be provided.
public class ApiUpdateRequest : ApiRequest { public List<ApiUploadDocument> Documents { get; set; } } public class ApiUploadDocument { public string FileName { get; set; } public byte[] Bytes { get; set; } }
See also:
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Header></s:Header> <s:Body> <UpdateSingle xmlns='Prodibas.API.V1'> <product xmlns:a='Prodibas.API.V1.Model' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> ... product properties... <a:Uris> ... uris... <a:ApiProductUri> ... uri properties... <a:Type>BILD</a:Type> <a:TypeIsSpecified>true</a:TypeIsSpecified> ... uri properties... <a:Uri>filename1.jpg</a:Uri> <a:UriIsSpecified>true</a:UriIsSpecified> </a:ApiProductUri> ... uris... <a:ApiProductUri> ... uri properties... <a:Type>MAN</a:Type> <a:TypeIsSpecified>true</a:TypeIsSpecified> ... uri properties... <a:Uri>filename2.pdf</a:Uri> <a:UriIsSpecified>true</a:UriIsSpecified> </a:ApiProductUri> ... uris... <a:ApiProductUri> ... uri properties... <a:Type>PROD</a:Type> <a:TypeIsSpecified>true</a:TypeIsSpecified> ... uri properties... <a:Uri>filename2.pdf</a:Uri> <a:UriIsSpecified>true</a:UriIsSpecified> </a:ApiProductUri> ... uris... </a:Uris> <a:UrisIsSpecified>true</a:UrisIsSpecified> ... product properties... </product> <structuredInputOptions xmlns:a='Prodibas.API.V1.Parameters.OutputOptions' i:nil='true' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'></structuredInputOptions> <requestOptions xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:Authentication> <a:CompanyIdentifier>MANU999</a:CompanyIdentifier> <a:Industry>VVS</a:Industry> <a:Key>DEVMANU999</a:Key> </a:Authentication> <a:Documents> <a:ApiUploadDocument> <a:Bytes>... a base64 encoded document</a:Bytes> <a:FileName>filename1.jpg</a:FileName> </a:ApiUploadDocument> <a:ApiUploadDocument> <a:Bytes>... another base64 encoded document</a:Bytes> <a:FileName>filename2.pdf</a:FileName> </a:ApiUploadDocument> </a:Documents> </requestOptions> </UpdateSingle> </s:Body> </s:Envelope> If no documents are provided, the documents section is set to null ... <a:Documents i:nil='true'> </a:Documents> ...
The ApiQueuedUpdateRequest object is one of the parameters for UpdateManyQueued. It's identical to ApiUpdateRequest but also includes the PingBackUrl.
public class ApiQueuedUpdateRequest : ApiUpdateRequest { public string PingBackUrl { get; set; } }
If PingBackUrl is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.
Most API responses contains a Data and a User object. What type Data is depends on the request method. The User object contains information about the user who made the request.
[DataContract(Name = "ApiResponse_{0}")] public class ApiResponse<T> { public T Data { get; set; } public ApiUser User { get; set; } } public class ApiUser { public int Id { get; set; } public string Email { get; set; } public string Name { get; set; } }
For example, a response could have the following signature:
ApiResponse<ApiProduct>
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <GetSingleByIdentifierResponse xmlns='Prodibas.API.V1'> (example method) <GetSingleByIdentifierResult xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:Data xmlns:b='Prodibas.API.V1.Model'> ... product properties... </a:Data> <a:User xmlns:b='http://schemas.datacontract.org/2004/07/WebService.V1.Parameters'> <b:Email i:nil='true'/> <b:Id>1</b:Id> <b:Name>Test Testsson</b:Name> </a:User> </GetSingleByIdentifierResult> </GetSingleByIdentifierResponse> </s:Body> </s:Envelope>
A queued/batched request returns a ApiQueuedResponse containing a QueueId
. The QueueId
is used to receive the result by using the
GetResult or
GetUpdateResult methods.
public class ApiQueuedResponse { public int QueueId { get; set; } }
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <GetManyByIdentifiersQueuedResponse xmlns='Prodibas.API.V1'> (example method) <GetManyByIdentifiersQueuedResult xmlns:a='Prodibas.API.V1.Parameters' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:QueueId>67640</a:QueueId> </GetManyByIdentifiersQueuedResult> </GetManyByIdentifiersQueuedResponse> </s:Body> </s:Envelope>
A PingBackUrl
can optionally be provided in all queued requests.
If PingBackUrl
is present, the service will make one HTTP GET request to notify the client-side that the queued work has been processed. Firewall port openings might be required on the client-side. Unreliable if there are network issues.
You can insert {QueueId}
into the pingback url and it will be replaced with the QueueId of the request.
If this is sent to the service:
http://myserver.mydomain.com?MyownId=ABC123&QueueId={QueueId}
It could result in a pingback call like this:
http://myserver.mydomain.com?MyownId=ABC123&QueueId=12345
Validation errors can be returned in the response as a result of a failed product(s) update operation.
Prodibas uses comprehensive validation of incoming data. Some of the rules relates to other products in the system. There are also rules
regarding roles and the right to change some data. If the API refuses to write data because of validation rules, it responds with one or several ApiModelValidationError
s.
Client side should always verify the result of writing data to Prodibas. Client side should also provide a way to present a report to the end-user.
public class ApiModelValidationError { public string Field { get; set; } public string Message { get; set; } }
<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <UpdateSingleResponse xmlns='Prodibas.API.V1'> (example method) <UpdateSingleResult xmlns:a='Prodibas.API.V1.Model' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:ApiModelValidationError> <a:Field>NameEn</a:Field> <a:Message> Artikel (4842188-123) valideringsfel. Fält: Benämning Engelsk. Ogiltigt antal tecken. Måste vara 30 eller färre. Angivet värde=AS123 NameEn UpdateSingle 17:44 </a:Message> </a:ApiModelValidationError> <a:ApiModelValidationError> <a:Field>Color</a:Field> <a:Message> Produkt (4842188-123) valideringsfel vid förändring. Fält: Färg. Värdet kan endast ändras av en administratör. </a:Message> </a:ApiModelValidationError> </UpdateSingleResult> </UpdateSingleResponse> </s:Body> </s:Envelope>
public class ApiManufacturer { public int Id { get; set; } public string Alias { get; set; } public string Name { get; set; } public string BankGiro { get; set; } public string PlusGiro { get; set; } public string OrgNumber { get; set; } public string VisitingAddress { get; set; } public string CoAddress { get; set; } public string Address { get; set; } public string Website { get; set; } public string ZipCode { get; set; } public string City { get; set; } public string Phone { get; set; } public string Fax { get; set; } public string Email { get; set; } public string CountryIdentifier { get; set; } public ApiManufacturerStatus Status { get; set; } public DateTime ModifiedAt { get; set; } public DateTime RegisteredAt { get; set; } public bool AllowUseApi { get; set; } public int ApiRoleUserId { get; set; } public bool IsContractSigned { get; set; } public bool IsWholesaler { get; set; } public bool IsMemberManufacturerCouncel { get; set; } public bool IsSafeWaterCertified { get; set; } public bool IsSafeWaterCertifiedIsSpecified { get; set; } public ApiManufacturerResponsibleInfo ResponsibleAdminInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleDocsInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleImagesInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleCEOInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleMarketInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleEconomyInfo { get; set; } public ApiManufacturerResponsibleInfo ResponsibleBvdInfo { get; set; } public ApiPayIdType PayId { get; set; } public string PayIdStr { get; set; } public string Ean { get; set; } public string InfoText { get; set; } public string InvoiceAddress { get; set; } public string InvoiceZipCode { get; set; } public string InvoiceCity { get; set; } public string InvoiceCountryIdentifier { get; set; } public string InvoiceReference { get; set; } public bool InvoiceByEmail { get; set; } public string UserMessage { get; set; } }
<b:Address>Drakenbergsgatan 21 BV</b:Address> <b:Alias>Gästföretaget!</b:Alias> <b:AllowUseApi>true</b:AllowUseApi> <b:ApiRoleUserId>1</b:ApiRoleUserId> <b:BankGiro>1111-1111</b:BankGiro> <b:City>Stockholm</b:City> <b:CoAddress>Testadress 2</b:CoAddress> <b:CountryIdentifier>SE</b:CountryIdentifier> <b:Ean/> <b:Email>info@vvsinfo.se</b:Email> <b:Fax>88888888888</b:Fax> <b:Id>616</b:Id> <b:InfoText/> <b:InvoiceAddress>Drakenbergsgatan 21 BV</b:InvoiceAddress> <b:InvoiceByEmail>false</b:InvoiceByEmail> <b:InvoiceCity/> <b:InvoiceCountryIdentifier>SE</b:InvoiceCountryIdentifier> <b:InvoiceReference/> <b:InvoiceZipCode/> <b:IsContractSigned>false</b:IsContractSigned> <b:IsMemberManufacturerCouncel>false</b:IsMemberManufacturerCouncel> <b:IsSafeWaterCertified>true</b:IsSafeWaterCertified> <b:IsSafeWaterCertifiedIsSpecified>false</b:IsSafeWaterCertifiedIsSpecified> <b:IsWholesaler>false</b:IsWholesaler> <b:ModifiedAt>2020-09-23T13:32:47</b:ModifiedAt> <b:Name>Gästföretaget</b:Name> <b:OrgNumber>5566775037</b:OrgNumber> <b:PayId>Inget</b:PayId> <b:PayIdStr>Inget</b:PayIdStr> <b:Phone>08-644 85 00</b:Phone> <b:PlusGiro>22222222-2</b:PlusGiro> <b:RegisteredAt>2016-04-27T09:01:19</b:RegisteredAt> <b:ResponsibleAdminInfo i:nil='true'/> <b:ResponsibleBvdInfo> <b:Email>test.testsson@gastforetaget.se</b:Email> <b:Name>Test Testsson</b:Name> <b:Phone>08-99 99 99</b:Phone> <b:Type>Bvd</b:Type> </b:ResponsibleBvdInfo> <b:ResponsibleCEOInfo i:nil='true'/> <b:ResponsibleDocsInfo i:nil='true'/> <b:ResponsibleEconomyInfo i:nil='true'/> <b:ResponsibleImagesInfo i:nil='true'/> <b:ResponsibleMarketInfo i:nil='true'/> <b:Status>Active</b:Status> <b:UserMessage/> <b:VisitingAddress>Drakenbergsgatan 21 (ingång 23)</b:VisitingAddress> <b:Website>www.vvsinfo.se</b:Website> <b:ZipCode>117 41</b:ZipCode>
public class ApiManufacturerResponsibleInfo { public ApiManufacturerResponsibleInfoType Type { get; set; } public string Name { get; set; } public string Email { get; set; } public string Phone { get; set; } }
<b:ResponsibleBvdInfo> <b:Email>test.testsson@gastforetaget.se</b:Email> <b:Name>Test Testsson</b:Name> <b:Phone>08-99 99 99</b:Phone> <b:Type>Bvd</b:Type> </b:ResponsibleBvdInfo>
public enum ApiManufacturerResponsibleInfoType { Admin = 0, Docs = 1, Images = 2, CEO = 4, Market = 8, Economy = 16, Bvd = 32 }
public enum ApiManufacturerStatus { Active = 0, // Aktiv Passive = 1, // Passiv NotCustomer = 2, // Ej anmäld - exkluderas Bankrupted = 3, // Konkurs Ceased = 4, // Upphört NotOnSwedishMarket = 5, // Ej på svenska marknaden - exkluderas NoActiveRSKNumbers = 6, // Har inga aktiva RSK-Nummer HasLeftMembership = 7, // Avböjt medverkan i RSK NewCustomer = 8, // Ny kund OnlyComfortManufacturer = 9 // Enbart Comfortleverantör }
public enum ApiPayIdType { Inget = 0, // Inget Annual = 1, // Betalning kalenderår Broken = 2, // Betalning brutet år Quarter = 3, // Betalning kvartal OtherCurrency = 4, // Betalning annan valuta }